using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using WebapiTemplate.Domain.Entity;
using WebapiTemplate.Infrastructure.Persistence.DomainConfiguration.Base;

namespace WebapiTemplate.Infrastructure.Persistence.DomainConfiguration
{
    /// <summary>
    /// 设置表字段，并继承基础字段的设置类
    /// </summary
   
    public class ExceptionLogConfiguration : BaseEntityConfiguration<ExceptionLog>
    {
        public override void Configure(EntityTypeBuilder<ExceptionLog> builder)
        {
            base.Configure(builder); //using Microsoft.EntityFrameworkCore;

            //设置表名
            builder.ToTable("app_exceptionlog"); //using Microsoft.EntityFrameworkCore;

            builder
                .Property(x => x.ExceptionMsg)
                .HasColumnName("exception_msg")
                .HasMaxLength(2000)
                .HasColumnOrder(1); //using Microsoft.EntityFrameworkCore;
        }
    }
}
